﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Liang.DataBase.DAL
{
    class DataSeeder
    {
        DBEntities _ctx;
        public DataSeeder(DBEntities ctx) 
        { 
            _ctx = ctx; 
        } 
 
        public void Seed() 
        { 
     
            try 
            { 
               
 
                _ctx.SaveChanges(); 
            } 
            catch (Exception ex) 
            { 
                string message = ex.ToString();  
                throw ex; 
            } 
            
        } 
 
        private static string[] SplitValue(string val) 
        { 
            return val.Split(','); 
        } 
 
        private string RandomString(int size) 
        { 
            Random _rng = new Random((int)DateTime.Now.Ticks); 
            string _chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; 
            char[] buffer = new char[size]; 
 
            for (int i = 0; i < size; i++) 
            { 
                buffer[i] = _chars[_rng.Next(_chars.Length)]; 
            } 
            return new string(buffer); 
        } 
 
     
    }
}
